package com.wisdom.benefit.jufa.widget;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Base64;
import android.widget.ImageView;

import com.wisdom.benefit.jufa.R;
import com.wisdom.benefit.jufa.base.BaseActivity;

import androidx.annotation.Nullable;

public class ShowImageZxingActivity extends BaseActivity {
    private ImageView iv;

    @Override
    protected int getLayout() {
        return R.layout.activity_show_image;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        iv = findViewById(R.id.show_image_iv);
        String base64 = getIntent().getStringExtra("imageBase");
        byte[] decodedString = Base64.decode(base64, Base64.DEFAULT);
        Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
        iv.setImageBitmap(decodedByte);
    }

    @Override
    protected void initViews() {

    }

    @Override
    protected int getTitleStringRes() {
        return 0;
    }
}
